//
//  ShopCartManager.h
//  LvXi_newVersion
//
//  Created by 王敏 on 16/9/8.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import <Foundation/Foundation.h>
@class ShopCartManager;
@protocol ShopCartManagerDelegate <NSObject>

@optional
-(void)ShopCartManager:(ShopCartManager*)manager didUpDateSelectedProductPrice:(CGFloat)price;

@end

@interface ShopCartManager : NSObject

/**选中商品*/
@property(nonatomic,strong)NSMutableArray * selectedProduct;

/**代理指针*/
@property(nonatomic,assign)id<ShopCartManagerDelegate>delegate;

+(void)setDelegate:(id<ShopCartManagerDelegate>)delegate;

+(instancetype)shareManager;

+(void)getAllProductComplete:(void(^)(NSArray * datas))complete;

+(void)addProduct:(Product*)product complete:(void(^)(NSArray * datas))complete;

+(void)removeProduct:(Product*)product complete:(void(^)(NSArray * datas))complete;

+(void)removeAllProduct:(Product *)product complete:(void (^)(NSArray *))complete;

+(void)addSelectedProduct:(Product*)product;

+(void)removeSelectedProduct:(Product*)product;



+(void)deleteSelectedProduct:(Product*)product;

+(CGFloat)calculateSelectedPrice;

+(NSInteger)numberOfProducts;

+(NSString*)format;

+(NSString*)formatName;


+(void)payForOrderID:(NSString*)orderid price:(CGFloat)price desc:(NSString*)desc complete:(void(^)(BOOL success))complete;


+(void)calculateSelectedPriceWithGreenBeanComplete:(void(^)(CGFloat totalPrice,CGFloat discountPrice,CGFloat userGreenBean))complete;

+(NSInteger)selectedCount;
@end
